﻿using System;

namespace SingleBlog.Framework
{
    /// <summary>
    /// 表示邮件消息。
    /// </summary>
    public class MailMessage : IMessage
    {
        /// <summary>
        /// 初始化 <see cref="MailMessage"/> 类的新实例。
        /// </summary>
        /// <param name="subject">邮件的标题。</param>
        /// <param name="body">邮件的正文。</param>
        /// <param name="to">邮件的接收地址。</param>
        public MailMessage(string subject, string body, string to)
        {
            this.Subject = subject ?? throw new ArgumentNullException(nameof(subject));
            this.Body = body ?? throw new ArgumentNullException(nameof(body));
            this.To = to ?? throw new ArgumentNullException(nameof(to));
        }

        /// <summary>
        /// 获取邮件的正文。
        /// </summary>
        public string Body { get; }
        /// <summary>
        /// 获取邮件的接收人邮箱地址。
        /// </summary>
        public string To { get; }
        /// <summary>
        /// 获取邮件的标题。
        /// </summary>
        public string Subject { get; }
    }
}
